<template>
  <div class="app-container">
    <div class="title">
      <h2>项目立项申请</h2>
      <el-button type="primary" plain @click="onSubmit">保存</el-button>
    </div>
    <el-form :model="form" ref="form" :rules="rules" label-width="135px" :inline="false" size="small">
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="部门" prop="val1">
            <el-input v-model="form.val1"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="经办人" prop="val2">
            <el-input v-model="form.val2"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="制单日期" prop="val3">
            <el-date-picker v-model="form.val3" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="项目名称" prop="val4">
            <el-input v-model="form.val4"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="项目编号" prop="val5">
            <el-input v-model="form.val5"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="项目类型" prop="val6">
            <el-input v-model="form.val6"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="项目执行周期(月)" prop="val9">
            <el-select v-model="form.val9" placeholder="请选择">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="项目总成本(元)" prop="val8">
            <el-input v-model="form.val8"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="直接成本" prop="val7">
            <el-input v-model="form.val81"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="间接成本" prop="val7">
            <el-input v-model="form.val82"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="项目总收入(元)" prop="val7">
            <el-input v-model="form.val7"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="下拨收入" prop="val7">
            <el-input v-model="form.val7"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="公司投入" prop="val7">
            <el-input v-model="form.val7"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="主要客户" prop="val10">
            <el-input v-model="form.val10"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="主要供应商" prop="val11">
            <el-input v-model="form.val11"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="是否涉及第三方" prop="val12">
            <el-select v-model="form.val12" placeholder="请选择">
              <el-option label="是" value="是" />
              <el-option label="否" value="否" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="项目利润率(税后)" prop="val18">
            <el-input v-model="form.val18"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="8">
          <el-form-item label="第三方厂商" prop="val12">
            <el-select multiple v-model="form.val121" placeholder="请选择">
              <el-option label="A" value="A" />
              <el-option label="B" value="B" />
              <el-option label="C" value="C" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="16">
          <el-form-item label="项目简介" prop="val19">
            <el-input type="textarea" resize="none" :autosize="{ minRows: 4, maxRows: 6 }"
              v-model="form.val19"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

  </div>
</template>

<script>
export default {
  data() {
    return {
      rules: {
        val4: [
          { required: true, message: '请输入项目名称', trigger: 'blur' },
        ],
        val5: [
          { required: true, message: '请输入项目编号', trigger: 'blur' },
        ],
        val19: [
          { required: true, message: '请输入项目简介', trigger: 'blur' },
        ]
      },
      options: [
        { label: '一个月', value: '一个月' },
        { label: '三个月', value: '三个月' },
        { label: '六个月', value: '六个月' },
        { label: '十二个月', value: '十二个月' },
        { label: '二十四个月', value: '二十四个月' },
        { label: '三十六个月', value: '三十六个月' },
      ],
      form: {}
    }
  },
  methods: {
    onSubmit() {

    }
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  position: relative;
  padding-top: 50px;
}

.el-select {
  width: 100%;
}

.title {
  background: #fff;
  height: 50px;
  position: fixed;
  top: 90px;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;

  h2 {
    margin: 0;
    margin-right: 20px;
  }
}
</style>